﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;

namespace EIS.Obj
{
    [XmlRoot("userLogon")]
    public class UserLogonDTO

    {   [XmlElement("userName")]
        public string UserName;
        [XmlElement("password")]
        public string Password;
        
        //Default constructor
        public UserLogonDTO(string username,string password)
        {
            UserName = username;
            Password = EncodeTo64(password);
        }
        public UserLogonDTO()
        {

        }

        static private string EncodeTo64(string toEncode)
        {

            byte[] toEncodeAsBytes

                  = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);

            string returnValue

                  = System.Convert.ToBase64String(toEncodeAsBytes);

            return returnValue;

        }

    }


}
